DEFINT A-Z
RANDOMIZE TIMER
CLS
INPUT "Vvedite velichinu massiva:", Dl
DIM M(Dl) AS SINGLE, a AS SINGLE, b AS SINGLE
FOR i = 1 TO Dl
M(i) = RND * 500
NEXT
Fr = FREEFILE
OPEN "B", Fr, "File.dat"
FOR i = 1 TO Dl
PUT #Fr, , M(i)
NEXT
CLOSE #Fr
OPEN "B", #Fr, "File.dat"
Fr2 = FREEFILE
OPEN "B", #Fr2, "File2.dat"
DO
GET #Fr, , a
IF EOF(Fr) THEN EXIT DO
GET #Fr, , a
IF EOF(Fr) THEN EXIT DO 'Можно влепить эксепшн, но не хочу
PUT #Fr2, , a
IF EOF(Fr2) THEN EXIT DO 'Аналогично
LOOP
CLOSE #Fr2, #Fr
PRINT " Proverim dannye:"
OPEN "B", #Fr, "File.dat"
OPEN "B", #Fr2, "File2.dat"
PRINT STRING$(50, 196) + " File.dat"
DO
GET #Fr, , a
IF EOF(Fr) THEN EXIT DO
PRINT a;
LOOP: PRINT STRING$(50, 196) + " File2.dat"
DO
GET #Fr2, , b
IF EOF(Fr2) THEN EXIT DO
PRINT b;
LOOP
CLOSE #Fr2, #Fr
Тестирование выполнено в программе QB64 ( Скачать )